﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

namespace Per_pixel_OCR
{
    public static class Parameters
    {
        public static int[] SelectedDigits = { 0, 2 };

        public static int UsedFeatureCountAtEveryNode = 300;
        public static int FeatureRange = 18; // -20,+20
        
        public static int MaxDepth = 20;

        public static int HistogramLength = 12;
      
        public static string TrainPath = "C:\\train.data";
        public static string TestPath = "C:\\test.data";

        public static string TestOutputPath = "C:\\testOutput.data";
        public static string TrainOutputPath = "C:\\trainOutput.data";

        public static int[] MinusThresholdCandidates = { -90, -16, 16, 90 };
        public static int[] PlusThresholdCandidates = { 32, 160, 300, 420 };

        public static string Log()
        {
            string rVal = "Parameters: " + Environment.NewLine + "-------------------" + Environment.NewLine;

            foreach (FieldInfo field in typeof(Parameters).GetFields())
            {
                if (field.FieldType == typeof(int[]))
                {
                    string temp = "{ ";

                    int[] tempArr = (int[])field.GetValue(null);
                 
                    for (int i = 0; i < tempArr.Length; i++)
                    {
                        temp += tempArr[i].ToString() + ", ";
                    }

                    temp += "}";

                    rVal += String.Format("{0} = {1}" + Environment.NewLine, field.Name, temp);
                }
                else
                {
                    rVal += String.Format("{0} = {1}" + Environment.NewLine, field.Name, field.GetValue(null));
                }
            }

            return rVal;
        }    
    }
}
